package com.leochan;

import java.io.IOException;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.leochan.shuniu.Global;
import com.leochan.shuniu.api.AuthorizeAPI;
import com.leochan.shuniu.api.MessageAPI;

public class ShuNiuClientActivity extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		Button btn = (Button) findViewById(R.id.btn);
		btn.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {

				try {
					AuthorizeAPI.authorize(ShuNiuClientActivity.this);
					// MessageService.threads(Global.token, 1);
					MessageAPI.messages_GET(Global.token);
					// MessageService.messages_send(Global.token);
					// NetworkService.current(Global.token, false, false);
				} catch (IOException e) {
					e.printStackTrace();
				}

			}

		});
	}
}